{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Try me\n", "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ffraile/computer_science_tutorials/blob/main/source/Databases/class%20exercises/4.%20Sorting%20and%20grouping.ipynb)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ffraile/computer_science_tutorials/main?labpath=source%2FDatabases%2Fclass%20exercises%2F4.%20Sorting%20and%20grouping.ipynb)\n", "In these exercises you are going to work with the car_retail.sql database in the folder test_databases. Copy the contents of the file in the schema panel and click\n", "**build schema**. Then, build queries as instructed in the exercises below:\n", "\n", "1. Write down a query that returns the rows in the table cars sorted by employeeId and Status.\n" ] }, { "cell_type": "markdown", "source": [ "2. Write down a query that returns the rows in the table Employees sorted by department name and hiring date." ], "metadata": { "collapsed": false } }, { "cell_type": "markdown", "source": [ "3. Write down a query that returns the average, standard_deviation, maximum, and minimum salary, and the maximum and minimum hiring dates across employees.\n" ], "metadata": { "collapsed": false } }, { "cell_type": "markdown", "source": [ "4. Write down a query that returns the average totalCost of cars grouped by employee.\n" ], "metadata": { "collapsed": false } }, { "cell_type": "markdown", "source": [ "5. Write down a query that returns the average difference between the totalCost of a car and the salary of the employee that made the sell. \n", "\n" ], "metadata": { "collapsed": false } } ], "metadata": { "kernelspec": { "display_name": "${KERNEL_SPEC_DISPLAY_NAME}", "language": "${KERNEL_SPEC_LANGUAGE}", "name": "${KERNEL_SPEC_NAME}" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" }, "pycharm": { "stem_cell": { "cell_type": "raw", "source": [], "metadata": { "collapsed": false } } } }, "nbformat": 4, "nbformat_minor": 0 }